<VirtualHost *:80>
    ServerName {{ web.domain }}
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/snitch.error.log
    CustomLog ${APACHE_LOG_DIR}/snitch.access.log combined

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

<VirtualHost *:443>
    ServerName {{ web.domain }}
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/snitch.error.log
    CustomLog ${APACHE_LOG_DIR}/snitch.access.log combined

    ProxyPreserveHost On
    ProxyPass	/	https://{{ web.bind_host }}:{{ web.bind_port }}/
    ProxyPassReverse	/	https://{{ web.bind_host }}:{{ web.bind_port }}/

    SSLEngine on
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off

    SSLCertificateFile	{{ var_data_path }}/config/http/ssl.crt
    SSLCertificateKeyFile {{ var_data_path }}/config/http/ssl.pem
</VirtualHost>